import java.util.Scanner;

public class homework29 {
    public static void main(String[] args) {
        int min = 0, k = 0, t = 0;
        int[] arr = new int[20];//存放整数的数组
        Scanner sc = new Scanner(System.in);//输入20个不同整数
        System.out.println("请输入20个整数(用空格分隔):");
        for (int i = 0; i < arr.length; i++)
            arr[i] = sc.nextInt();
        min = arr[0];
        for (int i = 0; i < arr.length; i++)
            if (arr[i] < min) {  //判断数组中的最小的数
                min = arr[i];
                k = i;//最小值的下标
            }
        if (k != 0) {
            t = arr[k];
            arr[k] = arr[0];
            arr[0] = t;
        }
        for (int a : arr)
            System.out.print(a + " ");
    }
}
